<template>
	<view class="managementBox">
		<!-- top的tab切换 -->
		<view class="nav">
			<view class="navList" v-for="item in navList" :key="item.id" @click="tabClick(item.id)">
				<view  :class="navIndex==item.id ?'navWorda':'navWord'">
					{{item.type}}
				</view>
			</view>
		</view>
		<!-- type类型切换 -->
		<!-- <view class="typeBox">
			<view v-for="item in typelist" :key="item.id" :class="typeIndex == item.id ?'typeBoxSN':'typeBoxS'" @click="typeTabClick(item.id)">
				{{item.typeNa}}
			</view>
		</view> -->
		<!-- type的类型 -->
		<view class="typeContent" v-if="navIndex == 1">
			<view class="typeList" v-for="(item,index) in contentList" :key="index" @click="datailsClick(item)">
				<!-- <view class="typeCtime">
					<view class="tyctime">
						{{item.ctime}}
					</view>
						<view :class="item.status==0?'tyStatus':item.status==1?'tyStatusA':item.status==2?'tyStatusB':''">
							{{item.status==0?'已审核':item.status==1?'未审核':item.status==2?'拒绝':''}}
						</view>
				</view> -->
				<view class="tyName">
					<view class="tyName1" style="min-width: 200rpx;">
						线索：
					</view>
					<view class="tyName2" >
						{{item.name}}
					</view>
				</view>
				<view class="tyBudget">
					<view class="tyBudget1" style="min-width: 200rpx;">
						A卡：
					</view>
					<view class="tyBudget2">
						{{item.mobile}}
					</view>
				</view>
				<view class="tyIntention">
					<view class="tyIntention1" style="min-width: 200rpx;">
						订单：
					</view>
					<view class="tyIntention2">
						{{item.cat_type}}
					</view>
				</view>
			</view>
		</view>
		<view class="typeContent" v-if="navIndex == 2">
			<view class="typeList" v-for="(item,index) in contentList" :key="index" @click="datailsClick(item)">
				<!-- <view class="typeCtime">
					<view class="tyctime">
						{{item.ctime}}
					</view>
						<view :class="item.status==0?'tyStatus':item.status==1?'tyStatusA':item.status==2?'tyStatusB':''">
							{{item.status==0?'已审核':item.status==1?'未审核':item.status==2?'拒绝':''}}
						</view>
				</view> -->
				<view class="tyName">
					<view class="tyName1">
						线索：
					</view>
					<view class="tyName2">
						{{item.name}}
					</view>
				</view>
				<view class="tyBudget">
					<view class="tyBudget1">
						A卡：
					</view>
					<view class="tyBudget2">
						{{item.budget}}
					</view>
				</view>
				<view class="tyIntention">
					<view class="tyIntention1">
						订单：
					</view>
					<view class="tyIntention2">
						{{item.cat_type}}
					</view>
				</view>
			</view>
		</view>
		<view class="fillBox" @click="fillClick">
			<image src="/static/pages/index/fillImg.png" class="fillImg" mode=""></image>
		</view>
	</view>
</template>

<script>
	import {filList} from '@/request/api.js'
	export default {
		data() {
			return {
				navList:[
					{
						type:"店铺数据",
						id:1
					}
					// ,
					// {
					// 	type:"客户数据",
					// 	id:2
					// },
				],
				navIndex:1,//nav切花
				typelist:[
					{
						typeNa:'全部',
						id:1
					},
					{
						typeNa:'已审核',
						id:2
					},
					{
						typeNa:'未审核',
						id:3
					},
					{
						typeNa:'拒绝',
						id:4
					}
				],
				typeIndex:1,//type切换
				contentList:[] //假数据
			};
		},
		onLoad(option) {
				// this.onlodeList()
			// if(option.id !== ""){
			// 	this.navIndex = option.id
			// 	this.onlodeList()
			// }else if(option.id == ""){
			// 	this.navIndex = '1'
			// 	this.onlodeList()
			// }
			
		},
		onShow() {
			this.onlodeList()
		},
		methods:{
			onlodeList(){
				let a = uni.getStorageSync("login");
				console.log(a)
				filList({
					type:uni.getStorageSync("login").type,
					user_id:a.id,
					cate:2,
				}).then(res => {
					console.log(res);
					this.contentList = res.data.data
					uni.showToast({
						title: res.msg,
						icon: "none"
					})
				})
			},
			tabClick(id){
				this.navIndex=id
				this.onlodeList()
			},
			//type切换
			typeTabClick(id){
				this.typeIndex=id
			},
			//审核详情
			datailsClick(item){
				//navIndex==1销售数据 反之亦然
				if(this.navIndex==1){
					uni.navigateTo({
						url:`/pagesA/DLR/administration?id=${item.id}`
					})
					
				}else{
					uni.navigateTo({
						url:`/pagesA/DLR/examineDetails?id=${item.id}`
					})
				}
				
			},
			//数据填报
			fillClick(){
				//navIndex==1销售数据 反之亦然
				if(this.navIndex==1){
					uni.navigateTo({
						url:'/pagesA/DLR/fillPages'
					})
				}else{
					uni.navigateTo({
						url:'/pagesA/DLR/customer'
					})
				}
			}
		}
	}
</script>

<style lang="scss">
	page{
		background-color: #FFFFFF;
	}
.managementBox{
	width: 100%;
	box-sizing: border-box;
	padding-bottom: 40rpx;
	overflow: hidden;
	position: relative;
	.nav{
		display: flex;
		justify-content: space-around;
		margin-top: 34rpx;
		.navList{
			.navWord{
				font-size: 36rpx;
				color: #909299;
				padding-bottom: 20rpx;
			}
		}
	}
	.typeBox{
		width: 100%;
		height: 100rpx;
		display: flex;
		justify-content: space-around;
		margin-top: 10rpx;
		.typeBoxS{
			color: #909299 ;
			font-size: 36rpx;
			line-height: 100rpx;
		}
	}
	.typeContent{
		width: 100%;
		overflow: hidden;
		.typeList{
			width: 670rpx;
			// height: 330rpx;
			box-sizing: border-box;
			margin: 40rpx auto 0;
			padding: 30rpx 0;
			box-shadow: 0rpx 0rpx 14rpx 0rpx rgba(211, 213, 220, 0.4);
			border-radius: 24rpx;
			.typeCtime{
				display: flex;
				justify-content: space-between;
				.tyctime{
					font-size: 26rpx;
					font-family: PingFang SC;
					font-weight: 500;
					color: #313233;
					margin-left: 25rpx;
					// margin-top: 24rpx;
				}
				.tyStatus{
					width: 90rpx;
					height: 36rpx;
					background: #1855F6;
					border-radius: 18rpx;
					font-size: 22rpx;
					font-family: PingFang SC;
					font-weight: 500;
					color: #F5F5F5;
					line-height: 36rpx;
					text-align: center;
					margin-top: 25rpx;
					margin-right: 24rpx;
				}
				.tyStatusA{
					width: 90rpx;
					height: 36rpx;
					background: #F69518;
					border-radius: 18rpx;
					font-size: 22rpx;
					font-family: PingFang SC;
					font-weight: 500;
					color: #F5F5F5;
					line-height: 36rpx;
					text-align: center;
					margin-top: 25rpx;
					margin-right: 24rpx;
				}
				.tyStatusB{
					width: 90rpx;
					height: 36rpx;
					background:#F61861;
					border-radius: 18rpx;
					font-size: 22rpx;
					font-family: PingFang SC;
					font-weight: 500;
					color: #F5F5F5;
					line-height: 36rpx;
					text-align: center;
					margin-top: 25rpx;
					margin-right: 24rpx;
				}
			}
			.tyName{
				margin-left: 25rpx;
				display: flex;
				// margin-top: 54rpx;
				.tyName1{
					color: #313233 ;
					font-size: 36rpx;
					// margin-right: 161rpx;
				}
				.tyName2{
					color: #313233 ;
					font-size: 36rpx;
				}
			}
			.tyBudget{
				margin-left: 25rpx;
				display: flex;
				margin-top: 54rpx;
				.tyBudget1{
					color: #313233 ;
					font-size: 36rpx;
					// margin-right: 161rpx;
				}
				.tyBudget2{
					color: #313233 ;
					font-size: 36rpx;
				}
			}
			.tyIntention{
				margin-left: 25rpx;
				display: flex;
				margin-top: 54rpx;
				.tyIntention1{
					color: #313233 ;
					font-size: 36rpx;
					// margin-right: 89rpx;
				}
				.tyIntention2{
					color: #313233 ;
					font-size: 36rpx;
				}
			}
		}
	}
	.fillBox{
		width: 130rpx;
		height: 130rpx;
		border-radius: 50%;
		position: fixed;
		bottom: 125rpx;
		right: 35rpx;
		image{
			width: 130rpx;
			height: 130rpx;
		}
	}
}
.navWorda{
	font-size: 36rpx;
	border-bottom: 2px solid #1855F6;
	padding-bottom: 20rpx;
	color: #1855F6;
	font-weight: 500;
}
.typeBoxSN{
	color: #1855F6 ;
	font-size: 36rpx;
	line-height: 100rpx;
}
</style>
